/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package plum.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import plum.CloneAction;
import plum.PlumPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Clone Action</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link plum.impl.CloneActionImpl#getNumberOfClones <em>Number Of Clones</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CloneActionImpl extends ActionImpl implements CloneAction {
	/**
	 * The default value of the '{@link #getNumberOfClones() <em>Number Of Clones</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumberOfClones()
	 * @generated
	 * @ordered
	 */
	protected static final String NUMBER_OF_CLONES_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getNumberOfClones() <em>Number Of Clones</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumberOfClones()
	 * @generated
	 * @ordered
	 */
	protected String numberOfClones = NUMBER_OF_CLONES_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CloneActionImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return PlumPackage.Literals.CLONE_ACTION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getNumberOfClones() {
		return numberOfClones;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNumberOfClones(String newNumberOfClones) {
		String oldNumberOfClones = numberOfClones;
		numberOfClones = newNumberOfClones;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, PlumPackage.CLONE_ACTION__NUMBER_OF_CLONES, oldNumberOfClones, numberOfClones));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case PlumPackage.CLONE_ACTION__NUMBER_OF_CLONES:
				return getNumberOfClones();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case PlumPackage.CLONE_ACTION__NUMBER_OF_CLONES:
				setNumberOfClones((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case PlumPackage.CLONE_ACTION__NUMBER_OF_CLONES:
				setNumberOfClones(NUMBER_OF_CLONES_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case PlumPackage.CLONE_ACTION__NUMBER_OF_CLONES:
				return NUMBER_OF_CLONES_EDEFAULT == null ? numberOfClones != null : !NUMBER_OF_CLONES_EDEFAULT.equals(numberOfClones);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (numberOfClones: ");
		result.append(numberOfClones);
		result.append(')');
		return result.toString();
	}

} //CloneActionImpl
